package com.kylewang.pomodoro;

import android.annotation.SuppressLint;
import android.os.Bundle;

import com.bytedance.scene.Scene;
import com.bytedance.scene.navigation.NavigationScene;
import com.bytedance.scene.navigation.NavigationSceneOptions;
import com.bytedance.scene.ui.template.BottomNavigationViewScene;
import com.bytedance.scene.utlity.SceneInstanceUtility;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;


import com.kylewang.pomodoro.ui.my.MyScene;
import com.kylewang.pomodoro.ui.plan.PlanScene;
import com.kylewang.pomodoro.ui.timer.TimerScene;

import java.util.LinkedHashMap;

//public final int APOMODORO = 25 * 60;

public class MainScene extends BottomNavigationViewScene {

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

    private Bundle getBundle(int index) {
        Bundle bundle = new Bundle();
        bundle.putInt("index", index);
        return bundle;
    }

    @Override
    protected int getMenuResId() {
        return R.menu.bottom_nav_menu;
    }

    @SuppressLint("RestrictedApi")
    @NonNull
    @Override
    protected LinkedHashMap<Integer, Scene> getSceneMap() {
        LinkedHashMap<Integer, Scene> linkedHashMap = new LinkedHashMap<Integer, Scene>();
        Bundle bundle = new Bundle();
        bundle.putInt("index", 0);
        NavigationScene navigationScene =(NavigationScene) SceneInstanceUtility.getInstanceFromClass(NavigationScene.class, new NavigationSceneOptions(TimerScene.class, getBundle(0)).toBundle());
        linkedHashMap.put(new Integer(R.id.navigation_timer), navigationScene);

        bundle.putInt("index", 1);
        navigationScene =(NavigationScene) SceneInstanceUtility.getInstanceFromClass(NavigationScene.class, new NavigationSceneOptions(PlanScene.class, getBundle(1)).toBundle());
        linkedHashMap.put(new Integer(R.id.navigation_plan), navigationScene);

        bundle.putInt("index", 2);
        navigationScene =(NavigationScene) SceneInstanceUtility.getInstanceFromClass(NavigationScene.class, new NavigationSceneOptions(MyScene.class, getBundle(2)).toBundle());
        linkedHashMap.put(new Integer(R.id.navigation_my), navigationScene);
        return linkedHashMap;
    }
}